import { DefineComponent } from "vue"

export type AcintionType = 'link' | 'button'

export interface TableActionItems<R = any> {
  // 权限
  permission?: string,
  // 类型
  type?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'default',
  // 图标
  icon?: DefineComponent,
  // 按钮模式
  textmode?: boolean,
  // 是否可见
  show?: (param: R) => boolean,
  // 操作回调
  call: (param: R) => Promise<any> | any,
  // 按钮内容
  textContent: string | ((p: R) => string),
  // 组件key
  key:string
}
export interface TableActionProps<T = any> {
  // 按钮风格
  actionType?: AcintionType,
  actions: TableActionItems<T>[],
  callParams: T,
}